<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增博客</title>
</head>
<lui:context/>
<u:View basePath="/res-datum/blog" userJS="blogAdd" userCSS="blogAdd" delayLoadJs="false">
<body>
<lui:dialogBody>
	<sys:dropCodeSet codeTypes="blogType" id="dropBlogType"/>
	<form class="m-cust" method="post" action="${ctx}/datum/file/doUpload" enctype="multipart/form-data" target="uploadIFrm" id='uploadArticle'>
		<iframe id="uploadIFrm" name="uploadIFrm" style="display:none;"></iframe>
		<div class="form-group m-narrow row" style='margin-left:0;'>
            <div class="col-xs-10">
                <label class="m-btn m-primary m-round-btn" for="xFile">上传文件</label><input class='m-file' type="file" id="xFile" 
					name='file' onchange="BlogAddPage.onFileChanged(this)">
				<button type="submit" class="m-btn m-color-charcoal-grey m-round-btn t-tag"><i class='fa fa-upload'></i>提交</button>
            </div>
        </div>
        <input type="hidden" name='immediately' value='false'>
        <input type="hidden" name='fileType' value='blog'>
        <input type="hidden" name='func' value='parent.BlogAddPage.onUploadSucc'>
    </form>
    <form class="m-cust" id="addBlogFrm">
    	<lui:ajax url="${ctx }/datum/blog/addBlog" id="addBlogAjax" formQuery="#addBlogFrm" type="post" formSubmit="true"
    		contentType="application/x-www-form-urlencoded" onSuccess="BlogAddPage.onAddBlogSucc"/>
        <div class="form-group m-narrow row">
        	<div class="col-xs-12">
                <div class="col-xs-2">
                    <label class="m-label required" for="blogName">标题：</label>
                </div> 
                <div class="col-xs-8">
                    <input name="blogName" autofocus="autofocus" id="blogName" class="form-control m-input" data-validate='true' data-not-empty='true' 
                        data-empty-text="标题不能为空" maxlength="100">
                </div>
            </div>
        </div>
        <div class="form-group m-narrow row">
        	<div class="col-xs-12">
                <div class="col-xs-2">
                    <label class="m-label" for="remarks">概述：</label>
                </div> 
                <div class="col-xs-8">
                    <textarea class='form-control m-input' id='remarks' cols="45" rows="4" name='remarks'></textarea>
                </div>
            </div>
        </div>
        <div class="form-group m-narrow row">
        	<div class="col-xs-12">
                <div class="col-xs-2">
                    <label class="m-label" for="blogType">博客类型：</label>
                </div> 
                <div class="col-xs-8">
                	<lui:dropList id="blogType" name="blogType.codeInfoValue" dropValues="dropBlogType.blogType" defaultValue="${requestScope.blogType }"
                		className="form-control m-input"/>
                </div>
            </div>
        </div>
        <div class="form-group m-narrow row">
        	<div class="col-xs-12">
                <div class="col-xs-2">
                    <label class="m-label" for="link">超链接：</label>
                </div> 
                <div class="col-xs-8">
                	<input name="link" id="link" class="form-control m-input" maxlength="255">
                </div>
            </div>
        </div>
        <input type='hidden' name='fileInfo.fileId' id='fileId'>
		<input type='hidden' name='blogId'>
		<input type="hidden" name='blogAttr' value='0'>
	</form>
</lui:dialogBody>
<lui:dialogFooter>
	<button class="btn btn-primary m-btn" type="button" onclick="BlogAddPage.saveBlog()">保存</button>
    <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box">关闭</button>
</lui:dialogFooter>
</body>
</u:View>
</html>